//
//  AppDelegate.m
//  YXKitOC
//
//  Created by 张鑫 on 2020/1/10.
//  Copyright © 2020 张鑫. All rights reserved.
//

#import "AppDelegate.h"
#import "ViewController1.h"
#import "YXBaseNavController.h"
#import "YXBaseTabBarController.h"
#import "ViewController2.h"
#import "ViewController3.h"
#import "YXKitOC.h"
#import "YXNoDataView.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    NSMutableArray *items = [[NSMutableArray alloc] init];
    NSArray *classes = @[[ViewController1 class], [ViewController2 class], [ViewController3 class]];
    for (int i = 0; i < 3; i++) {
        NSString *title = [NSString stringWithFormat:@"页面%@", @(i + 1)];
        [items addObject:@{@"title": title, @"image": @"tab_car_n", @"selectedImage": @"tab_car_n", @"class": [[classes[i] alloc] init]}];
    }
    
    // 配置返回按钮样式
    YXBaseVCConfig.sharedYXBaseVCConfig.navBackImage = YX_ImageNamed(@"yx_nav_back");
    YXBaseVCConfig.sharedYXBaseVCConfig.navBackTitle = @"返回";
    
    // 配置无数据图片
    YXNoDataViewConfig.sharedYXNoDataViewConfig.noDataImage = YX_ImageNamed(@"yx_image_nodata");
    
    YXBaseTabBarController *tabVC = [[YXBaseTabBarController alloc] initWithItems:items];
    
    UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    window.rootViewController = tabVC;
    
    self.window = window;
    [window makeKeyAndVisible];
    return YES;
}


@end
